Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Functions for Creating File Previews /


AddFilePreview

The AddFilePreview function allows you to add a preview to a file. You must have created the preview data yourself. If the specified file already has a preview defined, the AddFilePreview function replaces it with the new preview.

pascal OSErr AddFilePreview (short resRefNum, OSType previewType, 
                              Handle previewData); 
resRefNum
Specifies the resource file for this operation. You must have opened this resource file with write permission. If there is a preview in the specified file, the Movie Toolbox replaces that preview with a new one.
previewType
Specifies the resource type to be assigned to the preview. This type should correspond to the type of data stored in the preview. For example, if you have created a QuickDraw picture that you want to use as a preview for a file, you should set the previewType parameter to PICT.
previewData
Contains a handle to the preview data. For example, if the preview data is a picture, you would provide a picture handle.
DESCRIPTION
If you pass 0 for the previewType and previewData parameters, the file preview is removed.

ERROR CODES
File Manager errors
Memory Manager errors
Resource Manager errors

SEE ALSO
You can use the MakeFilePreview function, described in the previous section, to create a new preview for a file.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996